package com.dbz.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dbz.dao.BusinessDao;
import com.dbz.entity.Business;
import com.dbz.service.BusinessService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BusinessServiceImpl implements BusinessService {
    @Resource
    private BusinessDao businessDao;

    /**
     * 分页查询
     * @param page
     * @param queryMapper
     * @return
     */
    @Override
    public IPage<Business> selectPage(IPage<Business> page, Wrapper<Business> queryMapper) {
        return businessDao.selectPage(page,queryMapper);
    }

    /**
     * 删除客户信息
     * @param bid
     * @return
     */
    @Override
    public int delecteBusiness(String bid) {
        return businessDao.delecteBusiness(bid);
    }

    /**
     * 添加客户信息
     * @param bname
     * @param bphone
     * @return
     */
    @Override
    public int insertBusiness(String bname,String bphone) {
        return businessDao.insertBusiness(bname,bphone);
    }

    /**
     * 修改客户信息
     * @param bid
     * @param bname
     * @param bphone
     * @return
     */
    @Override
    public int updateBusiness(String bid, String bname, String bphone) {
        return businessDao.updateBusiness(bid,bname,bphone);
    }

    @Override
    public List<Business> selectAllBus() {
        return businessDao.selectList(null);
    }
}
